Learn R Programming

caracas (version 2.0.0)

[<-.caracas_symbol: Extract or replace parts of an object

Description

Extract or replace parts of an object

Usage

# S3 method for caracas_symbol
[(x, i, j, ...) <- value

Arguments

x

A caracas_symbol.

i

row indices specifying elements to extract or replace

j

column indices specifying elements to extract or replace

...

Not used

value

Replacement value

Examples

Run this code
if (has_sympy()) {
  A <- matrix(c("a", 0, 0, 0, "a", "a", "a", 0, 0), 3, 3)
  B <- as_sym(A)
  B[, 2] <- "x"
  B[, 3] <- vector_sym(3)
  B
}

Run the code above in your browser using DataLab